#Android架构/MVP
不能直接继承基类 IBasePresenter IBaseView 创建xxxContract
IBaseView
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| public interface IBaseView { * 显示加载动画 */ void showLoading(); * 隐藏加载 */ void hideLoading(); * 显示网络错误 * @param onRetryListener 点击监听 */ void showNetError(EmptyLayout.OnRetryListener onRetryListener); * 绑定生命周期 * @param <T> * @return */ <T> LifecycleTransformer<T> bindToLife(); }
|
IBasePresnter
1 2 3 4 5 6 7
| public interface IBaseNewPresenter { * 从网路中获取数据 */ void getData(); }
|
LoginContract
1 2 3 4 5 6 7 8
| public interface LoginContract { interface ILoginView extends IBaseView { } interface ILoginPresenter extends IBaseNewPresenter { } }
|